package com.kuang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/user01")
public class UserController01 {

    // @RequestParam("username")中，
    // 注解括号里的就是接收客户端的参数名，这样写也方便看
    @GetMapping("/t1")
    public String userContro1(@RequestParam("username")String name, Model model){
        model.addAttribute("msg",name);
        System.out.println(name);
        return "test";
    }
}
